/*----------------------------------------------------------------------------
 * Button Over
 * ---------------------------------------------------------------------------
 * Date      : 2011-02-08
 * Author    : naiyumie
 * ---------------------------------------------------------------------------
 * USAGE
 * ---------------------------------------------------------------------------
 *
 * ---------------------------------------------------------------------------
 * EXAMPLE
 * ---------------------------------------------------------------------------
 *
 *----------------------------------------------------------------------------
 */
$.fn.ButtonOver	= function (option)
{
	var element		= $(this);
	var option		= option || {};
	var changeImage	= function (obj, ext, action)
	{
		var img	= $(obj).find('img');
		var src	= $(img).attr('src');

		if (action=='over')
		{
			src	= src.replace('_on' + ext, ext);
			src	= src.replace(ext, '_on' + ext);
		}
		else { src	= src.replace('_on' + ext, ext); }

		$(img).attr('src', src);
	};

	$(element).find('a').each(function()
	{
		$(this).hover
		(
			function() { changeImage($(this), '.gif', 'over'); },
			function() { changeImage($(this), '.gif'); }
		)
		.focus(function()
		{
			changeImage($(this), '.gif', 'over');
		})
		.blur(function()
		{
			changeImage($(this), '.gif');
		});

	});
};
